<!-- /.content -->
<div class="row">
    <div class="col-sm-12">
        <form ng-class="{'submitted': submitted}" ng-submit="$ctrl.submit()">
            <actions back-url="$ctrl.backUrl" ng-if="$ctrl.backUrl"></actions>
            <content-filter ng-if="$ctrl.attrData" callback="$ctrl.loadSelected(nav,type)"></content-filter>
            <div class="card mb-4">
                <div class="card-header text-right" ng-if="$ctrl.attrSetName=='sys_menu_item'">
                    <a href="/portal/navigation/details?dataId={{$ctrl.parentId}}" class="btn bnt-sm btn-primary px-3">
                        <i class="fas fa-chevron-left"></i> Back
                    </a>
                    <a href="#" data-toggle="modal" data-target="#modal-content-filter"
                        class="btn bnt-sm btn-primary px-3">
                        <i class="fas fa-search"></i> Search links
                    </a>
                </div>

                <div class="card-header" ng-if="$ctrl.attrSetName=='sys_navigation'">
                    <h6>Create Navigation

                        <a href="/portal/navigation/list?attributeSetName=sys_navigation"
                            class="btn bnt-sm btn-primary px-3 float-right">
                            <i class="fas fa-chevron-left"></i> Back to list navs
                        </a>
                    </h6>
                </div>

                <div class="card-body">
                    <div class="row">
                        <div class="col-sm-12">
                            <div ng-repeat="value in $ctrl.attrData.values | orderBy:'priority' track by $index">
                                <div ng-switch="value.field.name">
                                    <div class="text-muted" ng-switch-when="menu_items">
                                        <menu-item-editor attribute-value="value" is-show-title="'true'"
                                            parent-type="'1'" parent-id="$ctrl.attrData.id"></menu-item-editor>
                                    </div>
                                    <div class="text-muted" ng-switch-default>
                                        <attribute-value-editor attribute-value="value" is-show-title="'true'"
                                            parent-type="'1'" parent-id="$ctrl.attrData.id"></attribute-value-editor>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <div class="row">
                        <div class="col-sm-12 text-right">
                            <button type="button" ng-click="$ctrl.submit()"
                                class="btn btn-primary btn-round pull-right px-5"><i class="fas fa-save"></i> Save
                                menu</button>
                        </div>
                    </div>
                </div>

            </div>
        </form>
    </div>
</div>